package org.dei.perla.rockfall.gui.queryforge;

import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;

public class QueryForgeRootPanel extends JTabbedPane implements ParameterConfigurationManipulator {

	private RunningStatusPanel rsPanel;
	private GainsStatusPanel gainsPanel;
	private ThresholdStatusPanel thPanel;
	private MiscStatusPanel miscPanel;
	private FilterStatusPanel filterPanel;
	public QueryForgeRootPanel(DSPicParameters parameters) {
		this.rsPanel = new RunningStatusPanel(parameters);
		this.gainsPanel = new GainsStatusPanel(parameters);
		this.thPanel = new ThresholdStatusPanel(parameters);
		this.miscPanel = new MiscStatusPanel(parameters);
		this.filterPanel = new FilterStatusPanel(parameters);
		
		JScrollPane scrollPane1 = new JScrollPane(this.rsPanel);
		JScrollPane scrollPane2 = new JScrollPane(this.filterPanel);
		this.addTab("Running status (RS)", scrollPane1);
		this.addTab("Guadagni", this.gainsPanel);
		this.addTab("Soglie", this.thPanel);
		this.addTab("Varie", this.miscPanel);
		this.addTab("Stato filtri", scrollPane2);
	}
	
	public void updateConfiguration() {
		this.rsPanel.updateConfiguration();
		this.gainsPanel.updateConfiguration();
		this.thPanel.updateConfiguration();
		this.miscPanel.updateConfiguration();
		this.filterPanel.updateConfiguration();
	}

	@Override
	public void readConfiguration() throws IllegaParamValueException {
		this.rsPanel.readConfiguration();
		this.gainsPanel.readConfiguration();
		this.thPanel.readConfiguration();
		this.miscPanel.readConfiguration();
		this.filterPanel.readConfiguration();
	}

}
